#include <iostream>
#include <vector>
using namespace std;

int find(vector<int>& v, int key)
{
	int left = 0, right = v.size() - 1;
	int ret = 0;
	while (left <= right)
	{
		int mid = left + (right - left) / 2;
		ret++;
		if (v[mid] < key)
		{
			left = mid + 1;
		}
		else if (v[mid] > key)
		{
			right = mid - 1;
		}
		else break;
	}
	return ret;
}

int main()
{
	vector<int> v = { 2,5,7,10,14,15,18,23,35,41,52 };
	cout << find(v, 12) << endl;
	return 0;
}